<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <button id='log_btn'>登录</button>
  <button id='list_btn'>获取列表</button>
</body>

</html>
<script>
  log_btn.onclick = () => {
    fetch('/login', {
      method: 'post',
      headers: new Headers({
        'Content-Type': 'application/json'
      }),
      body: JSON.stringify({
        name: "zhufeng",
        age: 12
      })
    })
  }
  list_btn.onclick = () => {
    fetch('/list')
  }
</script>